//
//  BaseTableVIew.swift
//  SunxianhuaTestApp
//
//  Created by abc on 2021/10/11.
//

import Foundation
import UIKit
import MJRefresh
class BaseTableVIew: EmptyTableView {
    
    var refreshDataBlock :(()->Void)?
    var loardMoreDataBlock :(()->Void)?
    
    
    override init(frame: CGRect, style:UITableView.Style) {
        super.init(frame: frame, style: style)
        
        self.emptyTitle = {
            return NSAttributedString.init(string: "暂无数据", attributes: [NSAttributedString.Key.foregroundColor:UIColor.colorUIHex("#CED0D6"),NSAttributedString.Key.font:UIFont.systemFont(ofSize: 14)])
        }
        
        self.emptyImage = { return UIImage.init(named: "noData_icon")}
        self.mj_header = MJRefreshNormalHeader.init {[weak self] in
            self?.refreshDataBlock?()
        }
        self.mj_footer = MJRefreshBackNormalFooter.init {[weak self] in
            self?.loardMoreDataBlock?()
        }
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
